public class Board {
    char[][] board = new char[15][15];

    public Board() {
        originBoard();
    }

    public void originBoard() {
        for (int i = 0; i < 15; i++) {
            for (int j = 0; j < 15; j++) {
                if (i == 0 && j == 0) {
                    board[0][0] = ' ';
                } else if (i == 0) {
                    board[i][j] = (char) ('A' + j - 1);
                } else if (j == 0) {
                    board[i][j] = (char) ('A' + i - 1);
                } else {
                    board[i][j] = '+';
                }
            }
        }
    }

        public void printBoard() {
        for (int i = 0; i < 15; i++) {
            for (int j = 0; j < 15; j++) {
                System.out.print(board[i][j] + " ");
            }
            System.out.println();
        }
    }

        public boolean checkWin(char chess) {
        for (int i = 1; i <= 10; i++) {
            for (int j = 1; j < 15; j++) {
                if (board[i][j] == chess &&
                        board[i][j] == board[i + 1][j] &&
                        board[i][j] == board[i + 2][j] &&
                        board[i][j] == board[i + 3][j] &&
                        board[i][j] == board[i + 4][j]) {
                    return true;
                }
            }
        }

         for (int i = 1; i < 15; i++) {
            for (int j = 1; j <= 10; j++) {
                if (board[i][j] == chess &&
                        board[i][j] == board[i][j + 1] &&
                        board[i][j] == board[i][j + 2] &&
                        board[i][j] == board[i][j + 3] &&
                        board[i][j] == board[i][j + 4]) {
                    return true;
                }
            }
        }

        for (int i = 1; i <= 10; i++) {
            for (int j = 1; j <= 10; j++) {
                if (board[i][j] == chess &&
                        board[i][j] == board[i + 1][j + 1] &&
                        board[i][j] == board[i + 2][j + 2] &&
                        board[i][j] == board[i + 3][j + 3] &&
                        board[i][j] == board[i + 4][j + 4]) {
                    return true;
                }
            }
        }

        for (int i = 1; i <= 10; i++) {
            for (int j = 5; j < 15; j++) {
                if (board[i][j] == chess &&
                        board[i][j] == board[i + 1][j - 1] &&
                        board[i][j] == board[i + 2][j - 2] &&
                        board[i][j] == board[i + 3][j - 3] &&
                        board[i][j] == board[i + 4][j - 4]) {
                    return true;
                }
            }
        }

        return false;
    }
}

